package pdfsetter.core.schema.advanced;

/**
 * AttachedFilePageSelector represents some file (its number) and selector which is attached to this file. When we will be setting some document we will select
 * pages from thiw file with given selector.
 * 
 * @author Andrzej Dorobisz
 */
public class AttachedFilePageSelector {
    private final FilePageSelector pageSelector;
    private final int fileNumber;

    public AttachedFilePageSelector(FilePageSelector pageSelector, int fileNumber) {
        this.pageSelector = pageSelector;
        this.fileNumber = fileNumber;
    }

    public FilePageSelector getFilePageSelector() {
        return pageSelector;
    }

    public int getFileNumber() {
        return fileNumber;
    }

    public AttachedFilePageSelection produceAttachedSelection(int fileSize) {
        return new AttachedFilePageSelection(pageSelector.selectPages(fileSize), fileNumber);
    }
}
